package com.ctshk.sapp.order.custom.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.ctshk.rpc.order.custom.req.tourist.CustomOrderTouristInfoExcelAddReq;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class CustomOrderTouristInfoExcelAddListener extends AnalysisEventListener<CustomOrderTouristInfoExcelAddReq> {

    @Getter
    @Setter
    private List<CustomOrderTouristInfoExcelAddReq> reqList = new ArrayList<>();

    //一行一行读取excel内容
    @Override
    public void invoke(CustomOrderTouristInfoExcelAddReq data, AnalysisContext analysisContext) {
        reqList.add(data);
        System.out.println("*****"+data);
    }

    //读取表头内容
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头： "+headMap);
    }

    //读取完成之后
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("数据读完了");
    }
}